!function(a) {
    function c(a) {
        return "object" == typeof a ? a : {
            top: a,
            left: a
        };
    }
    var b = a.scrollTo = function(b, c, d) {
        a(window).scrollTo(b, c, d);
    };
    b.defaults = {
        axis: "xy",
        duration: parseFloat(a.fn.jquery) >= 1.3 ? 0 : 1
    }, b.window = function() {
        return a(window).scrollable();
    }, a.fn.scrollable = function() {
        return this.map(function() {
            var d, b = this, c = !b.nodeName || -1 != a.inArray(b.nodeName.toLowerCase(), [ "iframe", "#document", "html", "body" ]);
            return c ? (d = (b.contentWindow || b).document || b.ownerDocument || b, a.browser.safari || "BackCompat" == d.compatMode ? d.body : d.documentElement) : b;
        });
    }, a.fn.scrollTo = function(d, e, f) {
        return "object" == typeof e && (f = e, e = 0), "function" == typeof f && (f = {
            onAfter: f
        }), "max" == d && (d = 9e9), f = a.extend({}, b.defaults, f), e = e || f.speed || f.duration, 
        f.queue = f.queue && f.axis.length > 1, f.queue && (e /= 2), f.offset = c(f.offset), 
        f.over = c(f.over), this.scrollable().each(function() {
            function l(a) {
                g.animate(j, e, f.easing, a && function() {
                    a.call(this, d, f);
                });
            }
            function m(a) {
                var d, e, f, c = "scroll" + a;
                return k ? (d = "client" + a, e = b.ownerDocument.documentElement, f = b.ownerDocument.body, 
                Math.max(e[c], f[c]) - Math.min(e[d], f[d])) : b[c];
            }
            var i, b = this, g = a(b), h = d, j = {}, k = g.is("html,body");
            switch (typeof h) {
              case "number":
              case "string":
                if (/^([+-]=)?\d+(\.\d+)?(px)?$/.test(h)) {
                    h = c(h);
                    break;
                }
                h = a(h, this);

              case "object":
                (h.is || h.style) && (i = (h = a(h)).offset());
            }
            a.each(f.axis.split(""), function(a, c) {
                var d = "x" == c ? "Left" : "Top", e = d.toLowerCase(), n = "scroll" + d, o = b[n], p = "x" == c ? "Width" : "Height";
                i ? (j[n] = i[e] + (k ? 0 : o - g.offset()[e]), f.margin && (j[n] -= parseInt(h.css("margin" + d)) || 0, 
                j[n] -= parseInt(h.css("border" + d + "Width")) || 0), j[n] += f.offset[e] || 0, 
                f.over[e] && (j[n] += h[p.toLowerCase()]() * f.over[e])) : j[n] = h[e], /^\d+$/.test(j[n]) && (j[n] = j[n] <= 0 ? 0 : Math.min(j[n], m(p))), 
                !a && f.queue && (o != j[n] && l(f.onAfterFirst), delete j[n]);
            }), l(f.onAfter);
        }).end();
    };
}(jQuery);